const path = require('path');
const fs = require('fs');
const plugInPath = path.join(path.resolve('./'), './plugIn');


var plugInArray = [];
try {
    plugInArray = fs.readdirSync(plugInPath);
} catch (error) {
    fs.mkdirSync(plugInPath);
};

var plugInList = [];

for (let i = 0; i < plugInArray.length; i++) {
    const element = plugInArray[i];
    var extname = path.extname(element);
    if (extname == '.asar') {
        var versionPath = path.join(plugInPath, element + '/version.json');
        var version = JSON.parse(fs.readFileSync(versionPath, 'utf-8'));
        version.path = element;
        plugInList.push(version);
    };
};

export default plugInList;














